function showPopup(element_id,event){
  var div = createElement("div");  
  div.id = "popup";
  //div.style.display="none";
  var popup = $(element_id);
  var evt = event ? event : (window.event ? window.event : null);  
  var x = Event.pointerX(evt)+5;
  var y = Event.pointerY(evt)+5;
  div.innerHTML='\
        <table style="top:' + y + 'px; left:' + x + 'px;" class="popup">\
          <tbody>\
            <tr>\
              <td class="corner" id="topleft"></td>\
              <td class="top"></td>\
              <td class="corner" id="topright"></td>\
            </tr>\
            <tr>\
              <td class="left"></td>\
              <td><table class="popup-contents">\
                <tbody>\
                    <tr>\
                      <td>' + popup.innerHTML + '</td>\
                    </tr>\
                </tbody>\
              </table></td>\
              <td class="right"></td>\
            </tr>\
            <tr>\
              <td id="bottomleft" class="corner"></td>\
              <td class="bottom"><!--<img src="/images/bubble-tail2.png" alt="popup tail" height="29" width="30">--></td>\
              <td class="corner" id="bottomright"></td>\
            </tr>\
          </tbody>\
        </table>';
  document.body.appendChild(div);
  //Element.show("popup");
}

function hidePopup(){
  Element.remove("popup");
}

function createElement(element) {
    if (typeof document.createElementNS != 'undefined') {
        return document.createElementNS('http://www.w3.org/1999/xhtml', element);
    }
    if (typeof document.createElement != 'undefined') {
        return document.createElement(element);
    }
    return false;
}

